<template>
	<view id="technology">
		<!-- 背景半椭圆 -->
		<view id="background-top" />
		
		<!-- 头部搜索框 -->
		<view class="header">
			<uni-row>
				<uni-col :span="24">
					<uni-search-bar class="searchBar" placeholder="请输入搜索内容" :radius="200" @confirm="toSearch" v-model="searchValue"
						clearButton="auto" cancelButton="none"/>
					
				</uni-col>
			</uni-row>
		</view>
		
		<!-- 广告板块 -->
		<view class="swiper">
			<image src="../../../static/img/swiper/swiper3.jpg" mode="scaleToFill"></image>
		</view>
		
		<!-- 服务板块 -->
		<view class="service-list">
			<view class="service-item" v-for="item in serviceList" :key="item.name">
				<uni-icons :type="item.icon" size="40px" color="#3a3a3a"></uni-icons>
				<view class="item-name">
					{{item.name}}
				</view>
			</view>
			
		</view>
	
		<!-- 技术推文列表 -->
		<view class="article-list">
		
			<view class="list-title">
				技术推文
			</view>
			<!-- 单例 -->		
			<view class="article-item"
			 v-for="item in articleList" :key="item.title"
			 @click="goWebView(item.url)">
				<view class="article-title">
					{{item.title}}
				</view>
				<view class="article-detail">
					{{item.detail}}
				</view>
			</view>

			<view class="reachBottom">
				<uni-load-more iconType="circle" :content-text="{contentdown:'加载更多'}" status="noMore" />
			</view>
		
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchValue:'',
				
				serviceList:[
					{icon:'calendar',name:"技术成果"},
					{icon:'navigate',name:"专家咨询"},
					{icon:'map',name:"线下服务"},
					{icon:'more',name:"更多"}
				],
				articleList:[
					{url:'http://www.nczfw.com/shuiguozhongzhi/357.html',title:'西瓜是热性还是凉性？',detail:'农村致富网 2021-08-14'},
					{url:'https://www.qianlaiye.com/cj/e15322.html',title:'如何防治秋季病虫害',detail:'智慧网 2021-04-24'},
					{url:'http://www.360doc6.net/wxarticlenew/852627672.html',title:'怎样“剪”才能克服苹果“大小年”',detail:'金旺果树微信公众号 2019-08-02'}
				]
			};
		},
		methods:{
			toSearch(){
				
			},
			goWebView(url){
				uni.navigateTo({
				    url:`../../webView/webView?url=${url}`
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	#background-top{
		margin: 0!important;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 150px;
		background-color: #ec3525;
		border-radius: 0 0 30% 30%;
		z-index: -10;
	}
	
	#technology{
		margin-top: 10px;
		>view{
			margin: 0 10px;
		}
		
		
		
		// 广告板块
		.swiper{
			margin-top: 10px;
			border-radius: 10px;
			overflow: hidden;
			
			
			>image{
				width: 100%;
				height: 150px;
				border-radius: 10px;
			}
		}
		
		// 服务板块
		.service-list{
			margin-top: 10px;
			display: flex;
			justify-content: space-between;
			align-items: center;
			flex-wrap: wrap;
			background-color: #fff;
			border-radius: 8px;
			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.08);
			
			.service-item{
				width: calc(50% - 5px);
				padding: 10px;
				text-align: center;
				
				.item-name{
					font-size: 14px;
					// font-weight: bold;
				}
			}
		}
		
		// 推文列表
		.article-list{
			margin: 0;
			margin-top: 10px;
			padding: 10px;
			padding-top: 5px;
			display: flex;
			align-items: center;
			flex-direction: column;
			background-color: #fff;
			border-radius: 20px 20px 0 0;
			// border: 1px solid rgba(0, 0, 0, 0.1);
			box-shadow: 0px -7px 3px -7px rgba(0, 0, 0, 0.08);
			
			.list-title{
				z-index: 10;
				position: sticky;
				top: 0;
				font-size: 16px;
				text-align: center;
				color: #909399;
				padding: 5px 0;
				font-weight: bold;
				background-color: #fff;
				width: 100%;
			}
			

			.article-item{
				margin-bottom: 10px;
				width: 100%;
				height: 100px;
				border-radius: 10px;
				background-image: linear-gradient(120deg, #ec3525 0%, #fda085 100%);
				// background-blend-mode: soft-light,screen;
				padding: 10px;
				color: white;
				
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				
				
				.article-title{
					font-size: 18px;
					font-weight: bold;
					// text-shadow: 0 2px 15px #c4b59d;
				}
				
				.article-detail{
					font-size: 14px;
					color: rgba($color: #fff, $alpha: 0.5);
					// text-shadow: 0 2px 9px #c4b59d;
				}
				
				
				
			}
		}
	}

</style>


<style lang="scss">
	#technology{
		
		.header{
			
			// 搜索框边框
			.uni-searchbar{
				padding: 0;
				
			}
			// 搜索框box
			.uni-searchbar__box{
				height: 30px;
				box-shadow: 0 0 3px 0 rgba($color: #000000, $alpha: 0.08);
			}
			
			// 咨询按钮
			.consult {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 30px;
				line-height: 30px;
				text-align: center;
				color: #3A3A3A;
				font-weight: bold;
			}
		}
	}
</style>